<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>父传子（props驼峰标识）</title>
  </head>
  <body>
    <div id="app">
      <cpn :cinfo="info" :child-my-message="message"></cpn>
    </div>
    <script src="../vue.js"></script>

    <template id="cpn">
      <div>
        <h2>{{cinfo}}</h2>
        <p>{{childMyMessage}}</p>
      </div>
    </template>
    <script>
      const cpn = {
        template: "#cpn",
        props: {
          cinfo: {
            type: Object,
            default() {
              return {};
            },
          },
          childMyMessage: {
            type: String,
            default: "",
          },
        },
      };
      const app = new Vue({
        el: "#app",
        data: {
          message: "小朋友你是不是有很多问号",
          info: {
            name: "enfb",
            age: 8,
            height: 1.66,
          },
        },

        components: {
          cpn,
        },
      });
    </script>
  </body>
</html>
